<%@ page language="java" %> 
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.List" %>
<%@page import="ar.unq.edu.agenda.domain.Contact" %>
<%@page import="ar.unq.edu.agenda.home.Agenda" %>
<%@page import="java.util.ArrayList" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../css/agenda.css" rel="stylesheet" type="text/css" />
<title>Contactos</title>
<script language="javascript">


</script>   
</head>
<body>
	<div id="top">
		<h1>Contactos</h1>
	</div>
	<form id="calc" method="POST">
		<input type="hidden" name="value1" id="value1" value=""/>
		<input type="hidden" name="value2" id="value2" value=""/>
		<input type="hidden" name="value2" id="operation" value=""/>
		<input type="hidden" name="result" id="result" value="0"/>
		<div id="container">
		<%
        List<Contact> contacts = new ArrayList<Contact>();
        if (request.getSession().getAttribute("contacts") != null) {
        	contacts = (List<Contact>) request.getSession().getAttribute("contacts");   
        }
		%>
			<table id="main">
				<tr>
					<th>Nombre</th>
					<th>Apellido</th>
					<th>Email</th>
				</tr>
		<%        
		for(Contact contact : contacts)
        {
		 %>
				<tr>
					<td><%=contact.getName() %></td>
					<td><%=contact.getLastName() %></td>
					<td><%=contact.getEmail() %></td>				
				</tr>
		<%} %>
			</table>
			</div>
	
		</form>
</body>
</html>